// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** addTeam POST /api/team/add */
export async function addTeamUsingPost(body: API.TeamAddRequest, options?: { [key: string]: any }) {
  return request<API.BaseResponselong>('/api/team/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'JWT': localStorage.getItem('loginUser') || 'manba',
    },
    data: body,
    ...(options || {}),
  });
}

/** deleteTeam POST /api/team/delete */
export async function deleteTeamUsingPost(body: number, options?: { [key: string]: any }) {
  return request<API.BaseResponseboolean>('/api/team/delete', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'JWT': localStorage.getItem('loginUser') || 'manba',
    },
    data: body,
    ...(options || {}),
  });
}

/** getTeamById GET /api/team/get */
export async function getTeamByIdUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getTeamByIdUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseTeam>('/api/team/get', {
    method: 'GET',
    headers: {
      'JWT': localStorage.getItem('loginUser') || 'manba',
    },
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** joinTeam POST /api/team/join */
export async function joinTeamUsingPost(
  body: API.TeamJoinRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseboolean>('/api/team/join', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'JWT': localStorage.getItem('loginUser') || 'manba',
    },
    data: body,
    ...(options || {}),
  });
}

/** listTeams GET /api/team/list */
export async function listTeamsUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.listTeamsUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseListTeamUserVO>('/api/team/list', {
    method: 'GET',
    headers: {
      'JWT': localStorage.getItem('loginUser') || 'manba',
    },
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** quitTeam POST /api/team/quit */
export async function quitTeamUsingPost(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.quitTeamUsingPOSTParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseboolean>('/api/team/quit', {
    method: 'POST',
    headers: {
      'JWT': localStorage.getItem('loginUser') || 'manba',
    },
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** searchTeamsByTags GET /api/team/search/Tags */
export async function searchTeamsByTagsUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.searchTeamsByTagsUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseListTeam>('/api/team/search/Tags', {
    method: 'GET',
    headers: {
      'JWT': localStorage.getItem('loginUser') || 'manba',
    },
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** updateTeam POST /api/team/update */
export async function updateTeamUsingPost(
  body: API.TeamUpdateRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseboolean>('/api/team/update', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'JWT': localStorage.getItem('loginUser') || 'manba',
    },
    data: body,
    ...(options || {}),
  });
}
